package luigibros.data.zip;

import java.awt.Image;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;

import javax.imageio.ImageIO;


public class ZipFileReader extends ZipFile {
	public ZipFileReader(File file) throws ZipException, IOException { super(file); }
	public ZipFileReader(File file, int mode) throws IOException { super(file, mode); }
	public ZipFileReader(String name) throws IOException { super(name); }
	
	public BufferedInputStream getEntryStream(String name) throws IOException {
		return new BufferedInputStream(this.getInputStream(this.getEntry(name)));
	}
	
	public Scanner getTextFile(String name) throws IOException {
		return new Scanner(this.getEntryStream(name));
	}
	
	public Image getImage(String name) throws IOException {
		return ImageIO.read(getEntryStream(name));
	}
}
